<%@ page language="java" import="java.util.*" contentType="text/html"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<title>问答题答案列表</title>
<link rel="stylesheet" type="text/css"
	href='<c:url value="/share/styles.css"></c:url>' />
<script src='<c:url value="/js/boot.js"></c:url>'></script>
<script src='<c:url value="/js/rqfui/rqfui.js"></c:url>'></script>
<style type="text/css">
body, html {
	width: 100%;
	height: 100%;
	margin: 0;
	font-family: "微软雅黑";
}

p {
	margin-left: 5px;
	font-size: 14px;
}

body {
	height: 100%;
	overflow: hidden;
}

.filterPan td {
	padding: 0;
}

.mini-splitter-pane {
	overflow: auto;
}

.mini-panel-body {
	padding: 0;
}

html body .searchbox .mini-buttonedit-icon {
	background: url('<c:url value="/share/img/magnifier-zoom.png"></c:url>')
		no-repeat 5% 5%;
}

.nameTitle {
	color: red;
}
.mini-pager {
    height: 40px !important;
}

#abc {
	position: absolute;
	top: 20%;
	left: 360px;
	z-index: 2;
}

.maskLayer {
	z-index: 10;
	opacity: 0.3;
	filter: alpha(opacity = 30);
	background-color: #ccc;
}

.questions_stems {
	border: 1px solid #a4a4a4;
	padding: 6px 12px;
	margin: 30px 30px 10px 30px;
	font-size: 16px;
	font-family: "微软雅黑";
	color: #8B8B8B;
}

.options {
	border: 1px solid #a4a4a4;
	padding: 10px 25px;
	margin: 20px 30px;
	font-size: 16px;
	font-family: "微软雅黑";
	color: #8B8B8B;
}

.options>li {
	padding: 10px 15px;
	font-size: 16px;
	font-family: "微软雅黑";
	color: #8B8B8B;
}

.answer {
	border: 1px solid #a4a4a4;
	padding: 10px;
	margin: 20px 30px;
	font-size: 16px;
	font-family: "微软雅黑";
	color: #8B8B8B;
}

.answer_detail {
	border: 1px solid #a4a4a4;
	padding: 10px;
	margin: 20px 30px 40px 30px;
	font-size: 16px;
	font-family: "微软雅黑";
	color: #8B8B8B;
}

.answer_detail>p {
	margin-left: 80px;
	max-height: 400px;
	overflow-y: auto;
}
</style>
</head>

<body>
	<!-- <div class="mini-toolbar"
		style="padding: 0px; border-width: 1px; border-bottom-width: 0px;">
		<table style="width: 100%;">
			<tr>
				<td style="width: 5px; height: 23px;"></td>
				<td width="100px"><a class="mini-button" id="resetBtn"
					iconCls="icon-reset" plain="true" onclick="reloadList">刷新</a></td>
				<td width="100px"><a class="mini-button" id="okBtn"
					iconCls="icon-ok" plain="true" onclick="confirm()">确定</a></td>
				<td><span id="separatorId" class="separator">&nbsp;&nbsp;查询日期:&nbsp;&nbsp;<input
						id="starting" class="mini-datepicker" style="width: 100px;"
						showNullItem="false" valueField="" onvalidation=""
						allowInput="false" emptyText="起始期间..." nullItemText="&lt;无&gt;" />
						<span
						style="vertical-align: middle; margin: auto 5px; display: inline-block;">至</span>
						<input id="ending" class="mini-datepicker" style="width: 100px;"
						showNullItem="false" valueField="" onvalidation=""
						allowInput="false" emptyText="截止期间..." nullItemText="&lt;无&gt;" />
						<a class="mini-button" id="seachOrgBtn" iconCls="icon-mag"
						onclick="onselect" tooltip="查询" plain="true">查询</a>
				</span></td>
			</tr>
		</table>
	</div> -->
	<div class="mini-fit">
		<div id='panLeft' size="400" showCollapseButton="true"
			style="padding: 0px; height: 100%; width: 100%;">
			<div id="datagrid1" class="mini-datagrid gridFull"
				borderStyle="border:1;" showReloadButton="true" pagesize="20"
				sizeList="[20,50,100,200]" allowCellWrap="true"
				allowHeaderWrap="true" idField="No" multiSelect="true"
				showPager="true" allowAlternating="true"
				ondrawcell="ondatagrid1DrawCell" onrowdblclick="gridRowDbClick"
				style="height: 100%; width: 100%; -moz-user-select: none; -webkit-user-select: none;"
				collapseGroupOnLoad="false" showColumnsMenu="false"
				showFilterRow="false" onshowrowdetail="onShowRowDetail">
				<div property="columns">
					<div field="user_uuid" width="100px" headerAlign="center"
						align="center" allowSort="true">
						用户
					</div>
					<!-- <div field="creater" width="100px" headerAlign="center"
						align="left" allowSort="true">
						编制人
					</div> -->
					<div field="updateTime" width="185px"
						dateFormat="yyyy-MM-dd hh:mm:ss" headerAlign="center"
						align="center" allowSort="true">回答时间</div>
					<div field="solution" width="300px" headerAlign="center"
						align="left" allowSort="true">
						答案
					</div>
					<div name="emptyCol" width='100%' headerAlign="center"
						align="center" cellStyle="padding:0;"></div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		mini.parse();
		mini_debugger = false;
		var rootPath = '${rootPath}';
		var order = '${order}';
		var paperId = '${paperId}';
		var datagrid1 = mini.get("datagrid1");
		var filterHelper = gridFilter();
		$(function() {
			loadGrid1();
		});
		//双击
		function loadGrid1() {
			var filterData = filterHelper.getFilterData();
			var postData = new Object();
			if (filterData != null || filterData.length > 0) {
				postData.filterdata = mini.encode(filterData);
			}
			var url = "<c:url value='/surveyAnalyze/solutionListData/' />" + paperId +"/" + order;
			datagrid1.load(url);
			datagrid1.load(postData);
		}
		function removeSearch() {
			filter1.setValue();
			filter1.setText();
			filter2.setValue();
			filter2.setText();
			filter3.setValue();
			filter3.setText();
			filter4.setValue();
			filter4.setText();
			starting.setValue();
			ending.setText();
			filterHelper.clearFilterData();
			loadGrid1();

		}
		function ondatagrid1DrawCell(e) {
			var row = e.row;
			var field = e.field;

			if (field == "Action") {
				var id = row.id;
				e.cellHtml = '<a class="aTagUnderLine" href="javascript:showTest('
						+ id + ',\'' + row.class_id + '\')">[预览]</a>';
			}

		}
		function reloadList() {
			datagrid1.reload();
		}

		function showTest(id, type) {
			var url = rootPath + "/surveyTest/testInfo/" + id;
			$.ajax({
				url : url,
				method : "post",
				dataType : "json",
				data : {},
				success : function(data) {
					if (data) {
						showDetail(data, type);
					} else {
						alert("获取信息失败！");
					}
				},
				error : function() {
					alert("失败！");
				}
			});
		}
	</script>
</body>
</html>